<script type="text/javascript">
	$(document).ready(function(){
	   $("a#link_login").each(function(){
	      var href = $(this).attr("href");
	      $(this).attr({ href: "#"});
	      $(this).click(function(){
	      	 $("#frame_principal").html('Cargando Pagina...');
	      	 $("#frame_principal").load(href);
	      });
	   });
	});
	
	function CambiarEstudiante(elem){
		//alert(elem.value);
		
		if(elem.value==1){
			$('#field_ocupacion').show();
			$('#field_dni').show();
			
			$('#field_centro_estudios').hide();
			$('#field_carrera').hide();
			$('#field_ciclo').hide();
			$('#field_codigo').hide();
			
		}else{
			$('#field_ocupacion').hide();
			$('#field_dni').hide();
			
			$('#field_centro_estudios').show();
			$('#field_carrera').show();
			$('#field_ciclo').show();
			$('#field_codigo').show();
		}
	}
</script>
<link rel="stylesheet" type="text/css" href="stylo_fng.css">
<?php if($msnregistracion != ""){ ?>
<div style="width:600px">
  <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border:#CCCCCC 1px solid; " background="<?php echo DIR_IMAGENES?>/fondotabla.gif">
    <tr>
      <td width="71"><img src="<?php echo DIR_IMAGENES?>/usuario.gif" alt="" width="52" height="52" /></td>
      <td width="527" height="8"><?php echo $msnregistracion;?></td>
    </tr>
  </table>
</div><?php } ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="396" valign="top"><div style="border-bottom:#CCC 1px solid; font-size:16px; color:#113597; font-weight:bold; padding-bottom:5px; margin:10px 0px">Iniciar sesión</div>
        <div><form action="index.php?c=seguridad&m=validar_usuario&t=1" method="post" id="formautenticacion">
          <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border:#CCCCCC 1px solid; " background="<?php echo DIR_IMAGENES?>/fondotabla.gif">
            <tr>
              <td width="16"></td>
              <td height="8"></td>
              <td></td>
            </tr>
            <tr>
              <td width="16"></td>
              <td width="83" height="28">Usuario:</td>
              <td width="295"><input type="text" name="txtuser_name" id="txtuser_name" class="text1" style="height:22px; width:95%" /></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td height="28">Contraseña:</td>
              <td><input type="password" name="txtpassword" id="txtpassword" class="text1" style="height:22px; width:95%" /></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td height="31">&nbsp;</td>
              <td><input type="image" src="<?php echo DIR_IMAGENES?>/ingresar.gif" width="119" height="23" style="padding:0px; border:0px" /></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td height="18">&nbsp;</td>
              <td><a id="link_login" href="index.php?c=tienda&amp;m=recuperarclave">Olvidaste tu contraseña?</a></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td height="18" colspan="2"><?php echo "<span class='span2'>".$mensaje."</span>";?></td>
            </tr>
          </table>
        </form>
      </div></td>
    <td width="26" valign="top">&nbsp;</td>
    <td width="537" valign="top">
    <div style="border-bottom:#CCC 1px solid; font-size:16px; color:#113597; font-weight:bold; padding-bottom:5px; margin:10px 0px">Registrarse aquí
    </div>
      <div>
      <form id="formconsulta" name="formconsulta" action="index.php?c=seguridad&amp;m=registrar_usuario" method="post" onSubmit="return validaregistracion(this);" >
        (*):Campos Obligatorios
      	<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border:#CCCCCC 1px solid;background-repeat:repeat-x; background-image:url(<?php echo DIR_IMAGENES?>/fondotabla.gif)">
          <tr>
            <td width="18"></td>
            <td height="8"></td>
            <td></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td height="28">Tipo de Persona:</td>
            <td>
            	<select id="tipo_persona" name="tipo_persona" onchange="CambiarEstudiante(this)">
            		<option value="0">Estudiante</option>
            		<option value="1">No Estudiante</option>
            	</select> 	
            </td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td height="28">Nombre de Usuario(*):</td>
            <td><input type="text" name="txtuser_name" id="txtuser_name" class="text1" style="height:22px; width:95%" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td height="28">Contraseña(*):</td>
            <td><input type="password" name="txtpassword" id="textfield7" class="text1" style="height:22px; width:95%" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td height="28">Confirmar contraseña:</td>
            <td><input type="password" name="txtrpassword" id="textfield8" class="text1" style="height:22px; width:95%" /></td>
          </tr>   
          <tr>
            <td width="18"></td>
            <td width="144" height="28">Nombres(*):</td>
            <td width="373"><input type="text" name="txtnombre" id="textfield" class="text1" style="height:22px; width:95%" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td height="28">Apellidos(*):</td>
            <td><input type="text" name="txtapellido" id="textfield5" class="text1" style="height:22px; width:95%" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td height="28">Sexo:</td>
            <td>
            	<select id="sexo_persona" name="sexo_persona">
            		<option value="1">Masculino</option>
            		<option value="0">Femenino</option>
            	</select> 	
            </td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td height="28">Correo(*):</td>
            <td><input type="text" name="txtcorreo" id="textfield6" class="text1" style="height:22px; width:95%" /></td>
          </tr>
          
          <tr>
            <td>&nbsp;</td>
            <td height="28">Dirección:</td>
            <td><input type="text" name="txtdireccion" id="textfield9" class="text1" style="height:22px; width:95%" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td height="28">Telefono:</td>
            <td><input type="text" name="txttelefono" id="textfield4" class="text1" style="height:22px; width:95%" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td height="31">Celular:</td>
            <td><input type="text" name="txtcelular" id="textfield10" class="text1" style="height:22px; width:95%" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td height="31">Fecha Nacimiento:</td>
            <td><input type="text" name="txtnacimiento" id="txtnacimiento" class="text1" value="2011-06-06" style="height:22px; width:95%" /></td>
          </tr>
          <tr id="field_centro_estudios">
            <td>&nbsp;</td>
            <td height="28">Centro Estudios:</td>
            <td>
            	<select id="centro_estudios" name="centro_estudios">
            		<?php foreach ($centros as $centro):?>
            			<option value="<?php echo $centro->id_centro_estudios?>"><?php echo $centro->nombre_centro?></option>
            		<?php endforeach;?>
            	</select> 	
            </td>
          </tr>
          <tr id="field_carrera">
            <td>&nbsp;</td>
            <td height="28">Carrera:</td>
            <td>
            	<select id="carrera" name="carrera">
            		<?php foreach ($carreras as $carrera):?>
            			<option value="<?php echo $carrera->id_carrera?>"><?php echo $carrera->nombre_carrera?></option>
            		<?php endforeach;?>
            	</select> 	
            </td>
          </tr>
          <tr id="field_ciclo">
            <td>&nbsp;</td>
            <td height="28">Ciclo:</td>
            <td>
            	<select id="ciclo" name="ciclo">
            		<option value="1">1</option>
            		<option value="2">2</option>
            		<option value="3">3</option>
            		<option value="4">4</option>
            		<option value="5">5</option>
            		<option value="6">6</option>
            		<option value="7">7</option>
            		<option value="8">8</option>
            		<option value="9">9</option>
            		<option value="10">10</option>
            	</select> 	
            </td>
          </tr>
          <tr id="field_codigo">
            <td>&nbsp;</td>
            <td height="31">Cod. Estudiante:</td>
            <td><input type="text" name="txtcod_estudiante" id="txtcod_estudiante" class="text1" style="height:22px; width:95%" /></td>
          </tr>
          <tr id="field_dni" style="display:none">
            <td>&nbsp;</td>
            <td height="31">DNI:</td>
            <td><input type="text" name="txtdni" id="txtdni" class="text1" style="height:22px; width:95%" /></td>
          </tr>
          <tr id="field_ocupacion" style="display:none">
            <td>&nbsp;</td>
            <td height="31">Ocupacion:</td>
            <td><input type="text" name="txtocupacion" id="txtocupacion" class="text1" style="height:22px; width:95%" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td height="31">&nbsp;</td>
            <td><input type="image" src="<?php echo DIR_IMAGENES?>/registrarse.gif" width="119" height="23" style="padding:0px; border:0px" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td height="18">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          
        </table>
        </form>
    </div></td>
  </tr>
</table>
